package com.neouton.crm.executiceManager.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.common.util.PageUtil;
import com.neouton.crm.executiceManager.entity.ManagerPurchaseOrderVO;
import com.neouton.crm.managerPayPlan.entity.ManagerPayPlan;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface IManagerPurchaseOrderService {

    /**
     * 分页查询综管采购列表
     *
     * @param page
     * @param entity
     * @return
     */
    PageUtil<ManagerPurchaseOrderVO> queryPurchaseOrdesByPage(IPage page, ManagerPurchaseOrderVO entity, String token);

    /**
     * 保存采购单
     */
    Integer saveOrUpdatePurchaseOrder(ManagerPurchaseOrderVO purchaseOrder,String token);

    /**
     * 更具采购单ID获取采购信息
     * @param purchaseOrdeId
     * @return
     */
    ManagerPurchaseOrderVO getPurchaseOrdeInfoById(Integer purchaseOrdeId);


    /**
     * 采购信息驳回审批
     * @param purchaseOrder
     * @return
     */
    Boolean rejectionPurchaseOrderInfo(ManagerPurchaseOrderVO purchaseOrder, String token);

    /**
     * 采购信息通过审批
     * @param purchaseOrder
     * @return
     */
    Boolean approvePurchaseOrderInfo(ManagerPurchaseOrderVO purchaseOrder,String token,Boolean auto);

    /**
     * 通过申请表主键查询现有数据
     * @param approvalId
     * @return
     */
    ManagerPurchaseOrderVO queryPurchaseOrderByApprovalId(Integer approvalId);

    /**
     * 通过申请表主键查询历史
     * @param approvalId
     * @return
     */
    ManagerPurchaseOrderVO queryPurchaseOrderHistoryByApprovalId(Integer approvalId);



    List<ManagerPayPlan> queryManagerPayPlanByPidAndPlanPeriod(ManagerPayPlan paymentPlan);

    List<ManagerPurchaseOrderVO> queryALLPurchaseOrders(String token);

    Boolean deletePurchaseOrderById(Integer purchaseOrdeId);

    /**
     * 综管采购列表导出
     *
     * @param response
     */
    void exportPurchaseOrdes(HttpServletResponse response, ManagerPurchaseOrderVO entit, String token) throws Exception;

    /**
     * 分页查询待办信息
     *
     * @param page
     * @param entity
     * @return
     */
    PageUtil<ManagerPurchaseOrderVO> queryApprovalPurByPage(IPage page, ManagerPurchaseOrderVO entity);


    /**
     * 分页查询已办信息
     *
     * @param page
     * @param entity
     * @return
     */
    PageUtil<ManagerPurchaseOrderVO> queryApprovalPurDoneByPage(IPage page, ManagerPurchaseOrderVO entity);

    /**
     * 分页查询申请记录信息
     *
     * @param page
     * @param entity
     * @return
     */
    PageUtil<ManagerPurchaseOrderVO> queryApprovalPurRecordByPage(IPage page, ManagerPurchaseOrderVO entity,String token);
}
